package view;

import java.awt.BorderLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;

/**
 * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
 * Builder, which is free for non-commercial use. If Jigloo is being used
 * commercially (ie, by a corporation, company or business for any purpose
 * whatever) then you should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details. Use of Jigloo implies
 * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
 * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
 * ANY CORPORATE OR COMMERCIAL PURPOSE.
 */
public class ConfigWindow extends javax.swing.JFrame {
	private JPanel jPanel1;
	private JLabel lblBaudRate;
	private JComboBox cmb3;
	private JComboBox cmb2;
	private JComboBox cmb1;
	private JButton btnCancel;
	private JButton btnSalvar;
	private JSeparator jSeparator1;
	private JLabel lblFabrica;
	private JLabel lblProject;
	private JPanel jPanel2;

	/**
	 * Auto-generated main method to display this JFrame
	 */
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				ConfigWindow inst = new ConfigWindow();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}

	public ConfigWindow() {
		super();
		initGUI();
	}

	private void initGUI() {
		try {
			BorderLayout thisLayout = new BorderLayout();
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(thisLayout);
			this.setTitle("i2M - Configurações");
			{
				jPanel2 = new JPanel();
				getContentPane().add(jPanel2, BorderLayout.SOUTH);
				jPanel2.setPreferredSize(new java.awt.Dimension(392, 34));
				jPanel2.setLayout(null);
				{
					btnSalvar = new JButton();
					jPanel2.add(btnSalvar);
					btnSalvar.setText("Salvar");
					btnSalvar.setLayout(null);
					btnSalvar.setBounds(89, 4, 93, 21);
				}
				{
					btnCancel = new JButton();
					jPanel2.add(btnCancel);
					btnCancel.setText("Cancelar");
					btnCancel.setLayout(null);
					btnCancel.setBounds(210, 4, 94, 21);
					btnCancel.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent e) {
							btnCancelMouseClicked(e);
						}
					});
				}
			}
			{
				jPanel1 = new JPanel();
				getContentPane().add(jPanel1, BorderLayout.CENTER);
				jPanel1.setLayout(null);
				jPanel1.setPreferredSize(new java.awt.Dimension(392, 137));
				{
					lblProject = new JLabel();
					jPanel1.add(lblProject);
					lblProject.setText("Protocolo:");
					lblProject.setLayout(null);
					lblProject.setBounds(12, 15, 117, 14);
				}
				{
					lblFabrica = new JLabel();
					jPanel1.add(lblFabrica);
					lblFabrica.setText("Meio Físico:");
					lblFabrica.setLayout(null);
					lblFabrica.setBounds(12, 43, 112, 14);
				}
				{
					lblBaudRate = new JLabel();
					jPanel1.add(lblBaudRate);
					lblBaudRate.setText("Baudrate:");
					lblBaudRate.setLayout(null);
					lblBaudRate.setBounds(13, 70, 124, 14);
				}
				{
					jSeparator1 = new JSeparator();
					jPanel1.add(jSeparator1);
					jSeparator1.setLayout(null);
					jSeparator1.setBounds(12, 102, 361, 10);
				}
				{
					ComboBoxModel cmb1Model = new DefaultComboBoxModel(
							new String[] { "---", "ModBUS", "TCP/IP" });
					cmb1 = new JComboBox();
					jPanel1.add(cmb1);
					cmb1.setModel(cmb1Model);
					cmb1.setBounds(123, 12, 146, 21);
				}
				{
					ComboBoxModel cmb2Model = new DefaultComboBoxModel(
							new String[] { "---", "USB", "RS-232" });
					cmb2 = new JComboBox();
					jPanel1.add(cmb2);
					cmb2.setModel(cmb2Model);
					cmb2.setBounds(123, 40, 146, 21);
				}
				{
					ComboBoxModel cmb3Model = new DefaultComboBoxModel(
							new String[] { "---", "9600", "19200" });
					cmb3 = new JComboBox();
					jPanel1.add(cmb3);
					cmb3.setModel(cmb3Model);
					cmb3.setBounds(124, 67, 145, 21);
				}
			}
			pack();
			this.setSize(400, 186);
			this.setLocationRelativeTo(null);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private void btnCancelMouseClicked(MouseEvent e) {
		this.dispose();
	}
}
